
import 'package:baselib/utils/md5_util.dart';
import 'package:framelib/config/api_config.dart';

class CommUtil{

  static String toStringKey(Map data) {
    String valueData = '';
    List<dynamic> keys = data.keys.toList();
    keys.sort();
    keys.forEach((key) {
      var value = data[key];
      if (value is List && value.isNotEmpty) {
        if (value[0] is String) {
          value = '["${value.join('","')}"]';
        } else {
          value = '[${value.join(',')}]';
        }
      }
      valueData = '${valueData}${key}${value}';
    });
    print(valueData);
    return Md5Util.generateMd5('${valueData}${ApiConfig.wyyx_app_id}').toUpperCase();
  }
}